<!DOCTYPE html>
<html lang="en">

<include file="CommonSidebar:common-head"/>
<link rel="stylesheet" href="__ROOT__/Application/Admin/Public/css/common.css">
<link href="__ROOT__/Application/Admin/Public/css/jquery.datetimepicker.css" rel="stylesheet">
<body>

<div id="wrapper">

    <!-- Navigation -->
    <include file="CommonSidebar:common-navbar"/>

    <div id="page-wrapper">
        <div class="row">
            <div class="col-lg-12">
                <h1 class="page-header">充值卡</h1>
            </div>
        </div>
        <div class="row">
            <div class="col-lg-2">
                <button class="btn btn-block btn-primary" onclick="add()">添加充值卡模型</button>
            </div>
        </div>
        <div class="row">
            <div class="col-lg-12">


                <div class="row">
                    <div class="col-md-12">
                        <div class="panel-body">
                            <div class="dataTable_wrapper">
                                <table class="table table-striped table-bordered table-hover" id="dataTables-example">
                                    <thead>
                                    <tr>
                                        <th style="text-align: center" width="25%">充值卡标题</th>
                                        <th style="text-align: center">充值金额</th>
                                        <th style="text-align: center">赠送金额</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <foreach name="DATA" item="v" key="k">
                                        <tr class="odd gradeX" id="tr{$v.unid}">
                                            <td>{$v.NAME}</td>
                                            <td>{$v.BJ_MONEY}</td>
                                            <td>{$v.ZS_MONEY}</td>
                                        </tr>
                                    </foreach>
                                    </tbody>
                                </table>
                            </div>
                            <!-- /.table-responsive -->
                        </div>

                    </div>
                </div>


            </div>
        </div>

    </div>
</div>

<!--添加-->
<div id="allayModal" class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog"
     aria-labelledby="mySmallModalLabel">
    <div class="modal-dialog modal-sm">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                        aria-hidden="true">&times;</span></button>
                <h4 class="modal-title text-center">添加充值卡模型</h4>
            </div>
            <form id="profitForm" action="{:U('Add')}" method="post" enctype="multipart/form-data">
                <div class="modal-body">
                    <div class="container-fluid">
                        <div class="row">

                            <div class="col-xs-12">
                                <label>充值卡标题</label>
                                <input type="text" id="UPDATE_TITLE" name="NAME" class="rugby-login form-control">
                            </div>
                            <div class="col-xs-12">
                                <label>充值金额</label>
                                <input type="number" id="UPDATE_SG_NUM" name="BJ_MONEY" class="rugby-login form-control" value="300">
                            </div>
                            <div class="col-xs-12">
                                <label>赠送金额</label>
                                <input type="number" name="ZS_MONEY" class="rugby-login form-control" value="10">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="submit">
                        确认
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>
<!--添加-->


<include file="CommonSidebar:common-script"/>
<script src="__ROOT__/Application/Admin/Public/js/jquery.datetimepicker.js"></script>
<!-- DataTables JavaScript -->
<script src="__ROOT__/Application/Admin/Public/bower_components/datatables/media/js/jquery.dataTables.min.js"></script>
<script src="__ROOT__/Application/Admin/Public/bower_components/datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.min.js"></script>

<!-- Custom Theme JavaScript -->
<script src="__ROOT__/Application/Admin/Public/dist/js/sb-admin-2.js"></script>
<!-- Page-Level Demo Scripts - Tables - Use for reference -->


<script type="text/javascript" src="__ROOT__/Application/Admin/Public/LoadPading/LoadPading.js?v=3"></script>
<link rel="stylesheet" href="__ROOT__/Application/Admin/Public/LoadPading/LoadPading.css" type="text/css"
      media="screen"/>


<script>
    $(document).ready(function () {
        $('#dataTables-example').DataTable({
            responsive: true
        });
    });
</script>
<script>
    function add() {
        $("#allayModal").modal("show");
    }

    function Update(elem) {
        var ID = elem.prev().val();
        var CODE  = elem.parent().prev().prev().prev().text();
        var TITLE = elem.parent().prev().prev().text();
        var SG_NUM = elem.parent().prev().text();
        $("#SJM_ID").val(ID);
        $("#UPDATE_CODE").val(CODE);
        $("#UPDATE_TITLE").val(TITLE);
        $("#UPDATE_SG_NUM").val(SG_NUM);
        $("#allayModal").modal("show");
    }
</script>
</body>

</html>
